<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<p>

</p>

<script>
    var canvas = d3.select("body")
                  .append("svg")
                  .attr("width",500)
                  .attr("height",500);

    var diagonal = d3.svg.diagonal()
                        .source({ x: 10 , y:10})
                        .target({ x: 300 , y: 300})

   canvas.append("path")
           .attr("fill","none")
           .attr("stroke","black")
           .attr("d",diagonal);

</script>

</body>
</html>